<!DOCTYPE html>
<!-- 
Template Name: Metronic - Responsive Admin Dashboard Template build with Twitter Bootstrap 3.1.1
Version: 2.0.2
Author: KeenThemes
Website: http://www.keenthemes.com/
Contact: support@keenthemes.com
Purchase: http://themeforest.net/item/metronic-responsive-admin-dashboard-template/4021469?ref=keenthemes
License: You must have a valid license purchased only from themeforest(the above link) in order to legally use the theme for your project.
-->
<!--[if IE 8]> <html lang="en" class="ie8 no-js"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9 no-js"> <![endif]-->
<!--[if !IE]><!-->

<html lang="en" class="no-js" ng-app="loginApp">

<!--<![endif]-->
<!-- BEGIN HEAD -->

<head><title>测试</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<script src="assets/plugins/jquery-1.10.2.min.js" type="text/javascript"></script>
</head>
<body>
<form >
deng  lu<br>
<input
							class="form-control placeholder-no-fix " 
							type="text"  name="usename"
							id="username" /><br>
							<input 
							class="form-control placeholder-no-fix " 
							type="password"  
							name="password" id="password" /><br><input type="button" value="登陆" onclick="login()">

 </form>
 <br>查询站点分页信息<br>
<input
							class="form-control placeholder-no-fix " 
							type="text"  name="username"
							id="pageNo" /><br>
							<input 
							class="form-control placeholder-no-fix " 
							type="text"  
							name="password" id="pageSize" /><br>
							<input 
							class="form-control placeholder-no-fix " 
							type="text"  
							name="password" id="current_state" /><br>
							<input type="button" value="查询" onclick="logins()">
 <br>通过站点id查询单个站点<br>
<input
							class="form-control placeholder-no-fix " 
							type="text"  name="username"
							id="station_id" /><br>
							<input type="button" value="查询" onclick="getStationById()">
							<br>通过站点id查询可用装的信息<br>
<input
							class="form-control placeholder-no-fix " 
							type="text"  name="username"
							id="stationid_" /><br>
							<input type="button" value="查询" onclick="getChargerByStationId()">
<br>根据桩的二维码获取桩的信息<br>
<input
							class="form-control placeholder-no-fix " 
							type="text"  name="username"
							id="getChargerByQrCode" /><br>
							<input type="button" value="查询" onclick="getChargerByQrCode()">
<br>查询预约记录<br>
 userPayCard: 用户卡号 必传
	   pageNo: 开始记录数 必传 
       pageSize: 返回记录数 必传
       bespeak_current_num 预约流水号<br>
<input class="form-control placeholder-no-fix " type="text"  name="userPacard"id="userPayCard" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="pageNo"id="pageNoToBespeak" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="pageSize"id="pageSizeToBespeak" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="bespeak_current_num"id="bespeak_current_num" /><br>
							
							<input type="button" value="查询" onclick="findBespeakFromUserCard()">		
<br>* userPayCard:用户卡号 必传
     * pageNo: 开始记录数  必传
     * pageSize: 返回记录数  必传
     * serial_number 充电流水号
     * offline_is_pay 是否结算 1--已结算 0--未结算	<br>	
  <input class="form-control placeholder-no-fix " type="text"  name="userPacard"id="userPayCard_charge" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="pageNo"id="pageNoToBespeak_charge" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="pageSize"id="pageSizeToBespeak_charge" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="serial_number"id="serial_number" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="offline_is_pay"id="offline_is_pay" /><br>							
							<input type="button" value="查询" onclick="findChargeFromUserCard()">		   
<br> charger_id" :电桩端口号  "port_no" : 电口编号    "qr_code" : 电桩二维码号 , 
	 * code [操作编号（410104;// 自动充满  
					410401;// 停止充满
					9302;// 预约
					9301;// 取消预约
	   userPayCard:用户卡号 
	   key:随机码
	   ControlAuthorizationCode:控制授权码 
	   bespeak_time:预约时长 单位：分钟，不能超过3600分钟  预约时必传
	   serial_number:流水号 消约、关闭充电时必传    <br>
<input class="form-control placeholder-no-fix " type="text"  name="charger_id"id="charger_id_controlChar" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="port_no"id="port_no_controlChar" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="qr_code"id="qr_code" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="code"id="code" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="userPayCard"id="userPayCard_controlChar" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="ControlAuthorizationCode"id="ControlAuthorizationCode" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="bespeak_time"id="bespeak_time" /><br>
<input class="form-control placeholder-no-fix " type="text"  name="serial_number" id="serial_numbers" /><br>							
							<input type="button" value="查询" onclick="controlChar()">		 	   										
							
<script type="text/javascript">
 window.onload=function(){
 alert("ss");
 }
 
var token="";
 function login(){
	$.ajax({
		type:'post',
		url:'/cms/enterpriselogins/enterpriselogin',
		data:{'account':$('#username').val(),'password':$('#password').val()},
		
		success:function(data){
			alert("eeeeee");
			alert(data);
			var obj=eval('('+data+')');
			
			var taken=obj.pojo;
			token=taken.token;
			alert(token);
			}
	})

 }
 login();
 token=token;
 function logins(){
	 alert(token);
	$.ajax({
		type:'post',
		url:'/cms/enterpriselogins/getStationListByPage',
		data:{'pageNo':$('#pageNo').val(),'pageSize':$('#pageSize').val(),'current_state':$('#current_state').val()},
		dataType: "json",
		beforeSend: function(request) {
            request.setRequestHeader("Authentication", token);
        },
		success:function(data){
			alert(token);
		alert(data.msg);
		alert(data.code);
		alert(data.list)
		}
	})
}
 function getStationById(){
		$.ajax({
			type:'get',
			url:'/cms/enterpriselogins/getStationById',
			data:{'station_id':$('#station_id').val()},
			dataType: "json",
			beforeSend: function(request) {
	            request.setRequestHeader("Authentication", token);
	        },
			success:function(data){
			alert(data);
			alert("code----"+data.code);
			alert("msg----"+data.msg);
			var list=data.list;
			alert("list----"+$.parseJSON(list));	
			}
		})
	}
 
 function getChargerByStationId(){
	 alert("token"+token);
	 alert($('#stationid_').val());
		$.ajax({
			type:'get',
			url:'/cms/enterpriselogins/getChargerByStationId',
			data:{'stationId':$('#stationid_').val()},
			dataType: "json",
			beforeSend: function(request) {
	            request.setRequestHeader("Authentication", token);
	        },
			success:function(data){
				alert(data);
				alert("code----"+data.code);
				alert("msg----"+data.msg);
				var list=data.list;
				alert("list----"+$.parseJSON(list));	
			}
		})
	}
 
 function getChargerByQrCode(){
	 alert($('#getChargerByQrCode').val());
		$.ajax({
			type:'get',
			url:'/cms/enterpriselogins/getChargerByQrCode',
			data:{'qr_code':$('#getChargerByQrCode').val()},
			dataType: "json",
			beforeSend: function(request) {
	            request.setRequestHeader("Authentication", token);
	        },
			success:function(data){
				document.write(data.msg);
				document.write(data.code);
				document.write(data.pojo);	
			}
		})
	}

 function findBespeakFromUserCard(){
	 alert($('#userPayCard').val());
		$.ajax({
			type:'post',
			url:'/cms/enterpriselogins/findBespeakFromUserCard',
			data:{'userPayCard':$('#userPayCard').val(),'pageNo':$('#pageNoToBespeak').val(),'pageSize':$('#pageSizeToBespeak').val(),
				'bespeak_current_num':$('#bespeak_current_num').val()},
			dataType: "json",
			beforeSend: function(request) {
	            request.setRequestHeader("Authentication", token);
	        },
			success:function(data){
				alert(data.msg);
				alert(data.code);
				var list=data.list;
				alert($.parseJSON(list));	

			}
		})
 }
 
 function findChargeFromUserCard(){
	 alert($('#userPayCard_charge').val());
		$.ajax({
			type:'post',
			url:'/cms/enterpriselogins/findChargeFromUserCard',
			data:{'userPayCard':$('#userPayCard_charge').val(),'pageNo':$('#pageNoToBespeak_charge').val(),'pageSize':$('#pageSizeToBespeak_charge').val(),
				'serial_number':$('#serial_number').val(),'offline_is_pay':$('#offline_is_pay').val()},
			dataType: "json",
			beforeSend: function(request) {
	            request.setRequestHeader("Authentication", token);
	        },
			success:function(data){
				alert(data);
				alert("code----"+data.code);
				alert("msg----"+data.msg);
				var list=data.list;
				alert("list----"+$.parseJSON(list));	
			}
		})
 }
 
 function controlChar(){
	 alert(token);
	 alert("serial_number:"+$('#serial_numbers').val());
		$.ajax({
			type:'post',
			url:'/cms/enterpriselogins/controlCharger',
			data:{'charger_id':$('#charger_id_controlChar').val(),'port_no':$('#port_no_controlChar').val(),'qr_code':$('#qr_code').val(),
				'code':$('#code').val(),'userPayCard':$('#userPayCard_controlChar').val(),'ControlAuthorizationCode':$('#ControlAuthorizationCode').val(),
				'bespeak_time':$('#bespeak_time').val(),'serial_number':$('#serial_numbers').val()},
			dataType: "json",
			beforeSend: function(request) {
	            request.setRequestHeader("Authentication", token);
	        },
			success:function(data){
			alert("data.msg"+data.msg);
			alert("data.code"+data.code);
			}
		})
 }
 
 
</script>
</body>
</html>